<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8" />
    <title>日期对象方法</title>
    <script>
        var d = new Date(2018, 11, 24, 10, 33, 30, 0);
        var year = d.getFullYear();
        var month = d.getMonth();
        var day = d.getDate();

        console.log(year);
        console.log(month);
        console.log(day);

        d.setFullYear(2008);

        console.log(d);
    </script>

<body>
</body>